package myschool.test;

import myschool.dao.SubjectDao;
import myschool.entity.Subject;
import myschool.util.MyBatisUtil;
import org.apache.ibatis.session.SqlSession;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author oldliu
 * @since 1.0
 */
public class SubjecTestPAge {
    public static void main(String[] args) {
        SqlSession s= MyBatisUtil.get();
        SubjectDao mapper = s.getMapper(SubjectDao.class);
        Map<String,Object> map=new HashMap<>();
        map.put("subjectname","氢弹回收");
        map.put("classhour",199);
        map.put("gradeid",9L);
        int r = mapper.add1(map);
        System.out.println("增加的结果是："+r);
        List<Subject> paging = mapper.paging(1, 10);
        paging.forEach(System.out::println);
        MyBatisUtil.close(s);
    }
}
